// 公共头部
import myHeader from "/pages/headerfoot/pages/header.vue";
//公共底部
import Tabbar from '/pages/headerfoot/pages/hitgamefooter.vue'
//打帮赛方法
import hitmatchcommon from '@/common/hitmatchcommon.js';
//cache缓存
import Cache from '@/utils/cache.js';

export default {
	components: {
		myHeader,
		Tabbar
	},
	data() {
		return {
			list:[{'title':'增加1次','prices':1},{'title':'增加2次','prices':2},{'title':'增加3次','prices':3},],
			info: '',
			selectd:0,//选中
		}
	},
	methods: {
		//开始支付
		pay() {
			var that = this;
			var data = {};
			data['cost']=0.01;
			data['pay_type']=18;
			data['make_user_id']=Cache.get('user_id');
			data['openid']=Cache.get('user_openid');
			hitmatchcommon.getPayParameterLibMethod(data).then(res => {
				if (res) {
					uni.requestPayment({
						provider: 'wxpay',
						timeStamp:res.timeStamp,
						nonceStr: res.nonceStr,
						package:res.package,
						signType: res.signType,
						paySign: res.paySign,
						success: function(res) {
							console.log('success:' + JSON.stringify(res));
						},
						fail: function(err) {
							console.log('fail:' + JSON.stringify(err));
						}
					});
				}
			});
			
	
		},
		//选中状态
		clickselected(index){
			var that=this;
			that.selectd=index;
		},
	}
}